package com.zuowei.ycy.ui;

import android.view.View;

import com.and.yzy.frame.base.BaseFrameFgt;
import com.zuowei.ycy.user.domain.ResultInfo;
import com.zuowei.ycy.user.util.AppJsonUtil;

import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Response;

/**
 * Created by yzy on 2016/4/18.
 */
public abstract class BaseFgt extends BaseFrameFgt{
    public  boolean isShowToast=true;
    @Override
    public void btnClick(View view) {

    }

    @Override
    public boolean setIsInitRequestData() {
        return false;
    }
    @Override
    public void onUserVisible() {

    }
    @Override
    public void onFailure(String result, Call<ResponseBody> call, Response<ResponseBody> response, int what) {
        if (isShowToast){
            ResultInfo resultInfo= AppJsonUtil.getResultInfo(result);
            showToast(resultInfo.getMessage());
        }
        super.onFailure(result, call, response, what);
    }
}
